<?php
$uid = $_POST['uid'];
include ("conn.php");
include ("findPage.php");
include ("findComment.php");
$sql = "SELECT * FROM likeList WHERE uid=".$uid;
$result = $conn->query($sql);
class likeObj{
	var $likePages = array();
	var $likeComments = array();
}
$sum = new likeObj;
if ($result->num_rows > 0) {
	while($row = $result->fetch_assoc()) {
		if($row['mode']=="1"){
			$tempPid = (int)$row['objId'];
			$tempPgaeInfo = findPage($tempPid);
			array_push($sum->likePages,$tempPgaeInfo);
		}else if($row['mode']=="2"){
			$temp = json_decode($row['objId']);
			$tempPid = (int)$temp[0];
			$tempPcoid = (int)$temp[1];
			$tempCommentInfo = findComment($tempPid,$tempPcoid);
			$tempPage = findPage($tempPid);
			array_push($tempCommentInfo,$tempPage[1]);
			array_push($sum->likeComments,$tempCommentInfo);
		}
	}
}
echo json_encode($sum);
?>